# $Id$
# Maintainer: Daniel Isenmann <daniel@archlinux.org>
# Contributor: orelien <aurelien.foret@wanadoo.fr>

pkgname=rp-pppoe
pkgver=3.12
pkgrel=1
pkgdesc="Roaring Penguin's Point-to-Point Protocol over Ethernet client"
arch=('i686' 'x86_64')
url="https://www.roaringpenguin.com/products/pppoe"
license=('GPL')
depends=('ppp=2.4.7' 'sh' 'net-tools')
backup=(etc/ppp/pppoe.conf etc/ppp/firewall-standalone etc/ppp/firewall-masq 
        etc/ppp/pppoe-server-options)
options=('!makeflags')
install=rp-pppoe.install
source=(http://www.roaringpenguin.com/files/download/rp-pppoe-$pkgver.tar.gz{,.sig} 
       adsl.service 
       kmode.patch)
validpgpkeys=('FC2E9B645468698FD7B21655C1842E2A126F42E0') # Dianne Skoll

prepare() {
  cd "$srcdir/$pkgname-$pkgver/src"
  patch -Np2 -i ../../kmode.patch
}

build() {
  cd "$srcdir/$pkgname-$pkgver/src"
  ./configure --prefix=/usr --sbindir=/usr/bin --enable-plugin
  make PLUGIN_DIR="/usr/lib/rp-pppoe" all rp-pppoe.so
}

package() {
  cd "$srcdir/$pkgname-$pkgver/src"
  make PLUGIN_DIR="/usr/lib/rp-pppoe" DESTDIR="$pkgdir" install

  #install -Dm755 "$srcdir/adsl" "$pkgdir/etc/rc.d/adsl"
  install -Dm644 "$srcdir/adsl.service" "$pkgdir/usr/lib/systemd/system/adsl.service"
}
md5sums=('216eb52b69062b92a64ee37fd71f4b66'
         'SKIP'
         '926b00aa2a0c0d3a21970acde9695e47'
         '8df35e67558b6b4567d1ab24c9202898')
